package solved;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/*
ID:		liluyan1
LANG:	JAVA
TASK:	subset
*/
public class subset {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new FileReader("subset.in"));
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
				"subset.out")));
		new subset().solve(f, out);
		out.close();
		System.exit(0);
	}
	
	private void solve(BufferedReader f, PrintWriter out) throws IOException {
		int N = read(f);
		if (N*(N+1)%4 != 0) {
			out.println(0);
			return;
		}
		
		int M = N*(N+1)/4;
		
		long[] dp = new long[M+1];
		dp[0] = 1;
		
		for (int i=1; i<=N; i++) {
			for (int j=M-i; j>=0; j--) {
				dp[j + i] += dp[j];
			}
		}
		
		out.println(dp[M]/2);
	}
	
	public int read(BufferedReader f) throws IOException {
		return Integer.parseInt(f.readLine());
	}
	
	public int[] read(BufferedReader f, int N) throws IOException {
		String[] t = f.readLine().split(" ");
		int[] a = new int[N];
		for (int i=0; i<N; i++) {
			a[i] = Integer.parseInt(t[i]);
		}
		return a;
	}
}
